/*
 * Copyright 2011 SWM Services GmbH.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package de.swm.commons.mobile.client.widgets.map;

import java.util.List;

import org.gwtopenmaps.openlayers.client.LonLat;
import org.gwtopenmaps.openlayers.client.Marker;

import com.google.gwt.user.client.ui.Widget;

import de.swm.commons.mobile.client.widgets.map.data.IStationData;
import de.swm.commons.mobile.client.widgets.map.data.LatLng;
import de.swm.commons.mobile.client.widgets.map.handlers.IMapMoveHandler;
import de.swm.commons.mobile.client.widgets.map.handlers.IMapZoomHandler;
import de.swm.commons.mobile.client.widgets.map.handlers.IStationPickHandler;

/**
 * Map View.
 * @author wiese.daniel
 * <br>copyright (C) 2012, SWM Services GmbH
 *
 */
public interface IMapView {
	
	/**
	 * Map will ask the controller for a new layer.
	 */
	public void changeLayer();

	/**
	 * Returns the maps as a Widget.
	 * @return the map as widget.
	 */
	Widget asWidget();

	/**
	 * Update station markers currently displayed on the map
	 * @param stations the staions to update
	 */
	void updateStationMarkers(List<? extends IStationData> stations);

	/**
	 * Drws a footway on the map.
	 * @param currentPos the current position
	 * @param stationPos the position of the target station
	 * @param wayPoints the waypoints
	 */
	void drawWaypoints(LonLat currentPos, LonLat stationPos, List<Marker> wayPoints);

	/**
	 * Centrs to the defualt position which is currently citicenter of munich
	 */
	void centerToDefaultPos();
	
	/**
	 * Centers the map to the passed position
	 * @param pos the position to center
	 */
	void centerPosition(LatLng pos);
	
	/**
	 * Centers the map to the passed position
	 * @param pos the position to center
	 * @param zoom the zoom leve
	 */
	void centerPosition(LatLng pos, int zoom);
	
	/**
	 * Updated the current potions.
	 * @param pos the current pos
	 */
	void setCurrentPosition(LatLng pos);
	
	/**
	 * Hides / Display currently known station markers.
	 * @param isVisible true if station should be visible
	 */
	void setStationVisibility(boolean isVisible);
	
	/**
	 * Sets the departure station on the map
	 * @param station the staion
	 */
	void setOriginStation(IStationData station);
	
	/**
	 * Sets the destination station on the map
	 * @param station the station
	 */
	void setTargetStation(IStationData station);
	
	/**
	 * Adds a click handler if the origin station was selected.
	 * @param handler the click handler
	 */
	void setOriginStationPickHandler(IStationPickHandler handler);
	
	/**
	 * Adds the target station click handler if the destination station was selected
	 * @param handler  the click handler
	 */
	void setTargetStationPickHandler(IStationPickHandler handler);
	
	/**
	 * Adds a map move handler.
	 * @param handler the handler
	 */
	void setMapMoveHandler(IMapMoveHandler handler);
	
	/**
	 * Add a map zoom handler
	 * @param handler the handler
	 */
	void setMapZoomHandler(IMapZoomHandler handler);

	/**
	 * Displays a route (e.g. of a Bus) on the map
	 * @param gpsPoints the gps points
	 */
	void displayConnectionRoute(List<? extends LatLng> gpsPoints);

}